import request from '@/utils/request'

/**
 * [获取全部角色信息分页集合]
 */
export function selectAllPage(size, current) {
  return request({
    url: '/role/getAllPage',
    method: 'get',
    params: { size: size, current: current }
  })
}

/**
 * [根据用户id获取当前用户拥有的角色id集合]
 */
export function getRoleIdListByUserId(userId) {
  return request({
    url: '/role/getRoleIdListByUserId',
    method: 'get',
    params: { userId: userId }
  })
}

/**
 * [获取全部角色信息集合]
 */
export function getAllList() {
  return request({
    url: '/role/getAllList',
    method: 'get'
  })
}
/**
 * [保存角色]
 * @param  {[type]} id       [角色id]
 * @param  {[type]} roleName [角色名]
 */
export function saveRole(id, roleName) {
  return request({
    url: '/role/saveRole',
    method: 'post',
    params: { id: id, roleName: roleName }
  })
}
/**
 * [删除角色]
 * @param  {[type]} id       [角色id]
 */
export function deleteRole(id) {
  return request({
    url: '/role/deleteRole',
    method: 'post',
    params: { id: id }
  })
}
